Statement with Empty Body (SEB)

Description:

SEB detects statements with empty bodies such as empty synchronized statements and finally blocks. These constructs may signal that some functionality should have been implemented but is missing. Otherwise, empty statements can be safely removed.

When the option Check catch clauses is set in the audit's properties, SEB also looks for empty catch blocks. Often in these cases, you should add error-handling code.

When the option Check loop bodies is set, SEB looks for empty bodies inside of for, while, and do loops. It is suggested to avoid this programming style.

When the option Check method bodies is set, SEB looks for empty bodies of non-virtual methods.

Incorrect:

try
   ...
except
end;

Correct:

try
   ...
except
    // handle exception
    ...
end;